<html>
<head><meta charset="utf-8"><title>Code tasks · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html">Code tasks</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="189501730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189501730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189501730">(Mar 02 2020 at 15:31)</a>:</h4>
<p>I recall that extensions can contribute tasks, and I believe RLS supports something like this. It would be nice if we could do the same thing. We do have a "Rust Analyzer: Run" command, but it's not integrated with Code and it only seems to support <code>cargo check</code>.</p>



<a name="189502345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189502345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189502345">(Mar 02 2020 at 15:37)</a>:</h4>
<p>The probelm is that Code's tasks are wrong :D</p>



<a name="189502425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189502425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189502425">(Mar 02 2020 at 15:38)</a>:</h4>
<p>They don't have access to the current context, so you can't really "run <strong>this</strong> test"</p>



<a name="189502688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189502688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189502688">(Mar 02 2020 at 15:40)</a>:</h4>
<p>I'm thinking more of "Run project", assuming you only have one binary in the project or workspace. Or "Debug project" which is even more of a mess currently.</p>



<a name="189503126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189503126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189503126">(Mar 02 2020 at 15:45)</a>:</h4>
<p>Yeah... I am not sure that's actually useful for non-trivial projects...</p>
<p>Creating default actions works if there are few actions. If there are many (and there <strong>are</strong> many for real projects), that's just bad UX.</p>
<p>What would work is an input box for entering <code>cargo comands</code>, which has completion, and which smartly remmebers last/predefined commands. Basically, exactly how IntellliJ's run configuaration infra works</p>



<a name="189503297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189503297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189503297">(Mar 02 2020 at 15:46)</a>:</h4>
<p>It's helpful for beginners -- "I installed this Rust IDE thing and it doesn't even let me run my programs"</p>



<a name="189503488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189503488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189503488">(Mar 02 2020 at 15:48)</a>:</h4>
<p>And a RLS feature parity gap:</p>
<p><a href="/user_uploads/4715/-XARr0FEGnhRAnpACd8qMnpS/image.png" target="_blank" title="image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/-XARr0FEGnhRAnpACd8qMnpS/image.png" target="_blank" title="image.png"><img src="/user_uploads/4715/-XARr0FEGnhRAnpACd8qMnpS/image.png"></a></div>



<a name="189503514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189503514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189503514">(Mar 02 2020 at 15:48)</a>:</h4>
<p>Yeah, that's true</p>



<a name="189503575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189503575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189503575">(Mar 02 2020 at 15:49)</a>:</h4>
<p>I guess just irrationally dislike implementing features in less than ideal way :)</p>



<a name="189503737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189503737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189503737">(Mar 02 2020 at 15:50)</a>:</h4>
<p>TBH, for simple stuff I liked the VS experience (hit Ctrl-F5, current project runs) better than the IntelliJ one (open project settings, add a configuration etc.)</p>



<a name="189503820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189503820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189503820">(Mar 02 2020 at 15:51)</a>:</h4>
<p>IntelliJ wins if you need to run different things, change the command line arguments and so on. But most often I didn't need that.</p>



<a name="189503898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189503898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189503898">(Mar 02 2020 at 15:52)</a>:</h4>
<p>Never used code tasks, <code>npm run stuff</code> or <code>cargo xtask stuff</code> is everything I need</p>



<a name="189504582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189504582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189504582">(Mar 02 2020 at 15:58)</a>:</h4>
<p>could we have a global "cargo run" command that asks you which binary to run if there are multiple options?</p>



<a name="189504629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189504629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189504629">(Mar 02 2020 at 15:58)</a>:</h4>
<p>I guess tasks can't run commands...</p>



<a name="189504979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189504979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189504979">(Mar 02 2020 at 16:01)</a>:</h4>
<p>Apparently in RLS you can click the settings icon and you'll get a snipped added to <code>tasks.json</code>, which you can then customize</p>



<a name="189505208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189505208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189505208">(Mar 02 2020 at 16:03)</a>:</h4>
<p>oh, that's pretty similar to intellij, isn't it (at least how I know it from java)</p>



<a name="189505681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Code%20tasks/near/189505681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Code.20tasks.html#189505681">(Mar 02 2020 at 16:07)</a>:</h4>
<p>Ah, nifty, I think RLS registers a new task type (<code>cargo</code>) and you can have custom attributes like <code>subcommand</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>